package com.cdwh.joylife.utils;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by huxing on 2017/7/12.
 */

public class TimeUtils {

    public static final String DEFALUT_FORMAT = "yyyy-MM-dd HH:mm";
    public static final String FILE_FORMAT = "yyyy_MM_dd_HH_mm";


    public static String format(long time) {

//        1517242000l

        SimpleDateFormat sdf = new SimpleDateFormat(DEFALUT_FORMAT);
        return sdf.format(new Date(time));
    }

    public static String format(long time, SimpleDateFormat sdf) {
//        1517242000

        return sdf.format(new Date(time));
    }
}
